#include"udp_server.hpp"
#include"err.h"
#include<memory>
using namespace std;
using namespace Server;

static void usage(string proc)
{

    cout<<"Usage:\n\t"<<proc<<"port\n"<<endl;
}

//./udp_server port
int main(int argc,char * argv[])
{
    if(argc!=2)
    {
        usage(argv[0]);
        exit(1);
    }
    uint16_t port =atoi(argv[1]); //端口号转换

    // unique_ptr<Udpserver>usvr(new Udpserver("1.1.1.1",1010));
     unique_ptr<Udpserver>usvr(new Udpserver(1010));

    
    usvr->Init();
    usvr->Start();
    

}